<?php
include ("include.php");
$sanpham = new class_sanpham();
//
$download_path = AddSlashes("../uploads/sanpham/");
if (isset($HTTP_GET_VARS['action'])) {
	if($HTTP_GET_VARS['action'] == "download" && $HTTP_GET_VARS['filename'] != ""){
		header('Content-type: application/x-octet-stream');
		header('Content-disposition: attachment; filename=' . urldecode($HTTP_GET_VARS['filename']));
		readfile($download_path . '/' . urldecode($HTTP_GET_VARS['filename']));
		exit;
	}
}



//Layout
$layout_file = $arr_layout["shopping"];
include("html_layout.php");

if ($langid > 0){
	$sql = "select * from sanpham where sanpham_cat='$id' order by orders, maso";
}else{
	$sql = "select * from sanpham where sanpham_cat_vn='$id' order by orders, maso";
}

//$sql = "select * from sanpham where langid='$langid' and sanpham_cat='$id' order by maso";
//echo "$sql<br>";
$str_content = $sanpham->list_item($sql, 3, SP_IMAGES_SMALL_WIDTH, $which_page);
$str_htm = ereg_replace("@noidung@", "$str_content", $str_htm);

//Header Loading - CSS, Meta, Javascript ...
include("html_header.php");

//Body Loading - Date-Time, ...
include("html_body.php");	

$menu_left_id = $arr_tintuc_id[$langid]["shopping"];
//Menu include
include("html_menu.php");

//Modules include
include("modules.php");

print $str_htm;
?>